


Namespace Kardex
Public Class Kardex



 Public Function Combo(ByVal vTodos As Boolean, Optional ByVal vmensaje As String = "Todos") As Entity.Kardex.KardexCol
dim objCol as  New entity.Kardex.KardexCol
dim obj as  New Data.Kardex.Kardex
objCol = obj.Listar("", _
		-1, _
		-1, _
		"", _
		-1, _
		-1, _
		-1, _
		-1, _
		-1, _
		0, _
		-1, _
		-1)
 If vTodos Then
Dim ent As New Entity.Kardex.Kardex( _ 
		-1, _
		vmensaje , _
		"", _
		-1, _
		-1, _
		-1, _
		-1, _
		-1, _
		0, _
		-1, _
		-1)
objCol.AddPrimero(ent)
End If
Return objCol
End Function


'***************************


public Function Listar(KardexId as integer) as Entity.Kardex.Kardex

dim objEnt as  New entity.Kardex.Kardex
dim obj as  New Data.Kardex.Kardex
return obj.Listar(KardexId)

End Function


'***************************



public Function Listar( _
		KardexId as Integer, _
		ProductoId as Integer, _
		ALmacenId as String, _
		TipoId as Integer, _
		Cantidad as Integer, _
		CantidadIn as Integer, _
		CantidadOut as Integer, _
		Total as Integer, _
		Fecha as Long, _
		TipoMovimientoId as Integer, _
		Referencia as Integer) _
as  Entity.Kardex.KardexCol

dim objCol as  New entity.Kardex.KardexCol
dim obj as  New Data.Kardex.Kardex
return obj.listar("", _
		KardexId, _
		ProductoId, _
		ALmacenId, _
		TipoId, _
		Cantidad, _
		CantidadIn, _
		CantidadOut, _
		Total, _
		Fecha, _
		TipoMovimientoId, _
		Referencia)

End Function


'***************************


public Function Grabar( _
		KardexId as Integer, _
		ProductoId as Integer, _
		ALmacenId as String, _
		TipoId as Integer, _
		Cantidad as Integer, _
		CantidadIn as Integer, _
		CantidadOut as Integer, _
		Total as Integer, _
		Fecha as Long, _
		TipoMovimientoId as Integer, _
		Referencia as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Kardex.Kardex
 if KardexId=-1 then 
_codigo= obj.insert( "", _
		KardexId , _
		ProductoId , _
		ALmacenId , _
		TipoId , _
		Cantidad , _
		CantidadIn , _
		CantidadOut , _
		Total , _
		Fecha , _
		TipoMovimientoId , _
		Referencia , _
 vUSuario )
else
_codigo= obj.update( "", _
		KardexId , _
		ProductoId , _
		ALmacenId , _
		TipoId , _
		Cantidad , _
		CantidadIn , _
		CantidadOut , _
		Total , _
		Fecha , _
		TipoMovimientoId , _
		Referencia , _
 vUSuario )
end if 
return _codigo

End Function


'***************************


public Function Insertar( _
		KardexId as Integer, _
		ProductoId as Integer, _
		ALmacenId as String, _
		TipoId as Integer, _
		Cantidad as Integer, _
		CantidadIn as Integer, _
		CantidadOut as Integer, _
		Total as Integer, _
		Fecha as Long, _
		TipoMovimientoId as Integer, _
		Referencia as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Kardex.Kardex
_codigo= obj.insert( "", _
		KardexId, _
		ProductoId, _
		ALmacenId, _
		TipoId, _
		Cantidad, _
		CantidadIn, _
		CantidadOut, _
		Total, _
		Fecha, _
		TipoMovimientoId, _
		Referencia, _
 vUSuario )
return _codigo

End Function


'***************************


public Function Updatear( _
		KardexId as Integer, _
		ProductoId as Integer, _
		ALmacenId as String, _
		TipoId as Integer, _
		Cantidad as Integer, _
		CantidadIn as Integer, _
		CantidadOut as Integer, _
		Total as Integer, _
		Fecha as Long, _
		TipoMovimientoId as Integer, _
		Referencia as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Kardex.Kardex
_codigo= obj.Update( "", _
		KardexId , _
		ProductoId , _
		ALmacenId , _
		TipoId , _
		Cantidad , _
		CantidadIn , _
		CantidadOut , _
		Total , _
		Fecha , _
		TipoMovimientoId , _
		Referencia , _
 vUSuario )
return _codigo

End Function


'***************************


public Function ELiminar(  KardexId as integer,vusuario as integer ,optional vopcion as string="Delete") as integer
dim _codigo as integer =-1
dim obj as  New Data.Kardex.Kardex
_codigo= obj.Eliminar( "vopcion", KardexId ,vusuario)
return _codigo

End Function

End Class



end namespace

